if (!(temp_file_is_regular || is_symlink))
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Unsupported file type %u", g_file_info_get_file_type (file_info));
goto out;
}
if (filter_result == OSTREE_REPO_COMMIT_FILTER_ALLOW)
{
+ GFileType file_type;
+
child = g_file_get_child (dir, name);
- if (g_file_info_get_file_type (child_info) == G_FILE_TYPE_DIRECTORY)
+ file_type = g_file_info_get_file_type (child_info);
+ switch (file_type)
+ {
+ case G_FILE_TYPE_DIRECTORY:
+ case G_FILE_TYPE_SYMBOLIC_LINK:
+ case G_FILE_TYPE_REGULAR:
+ break;
+ default:
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Unsupported file type: '%s'",
+ gs_file_get_path_cached (child));
+ goto out;
+ }
+
+ if (file_type == G_FILE_TYPE_DIRECTORY)
{
if (!ostree_mutable_tree_ensure_dir (mtree, name, &child_mtree, error))
goto out;
assert_file_has_content cow-mtime 0
echo "ok content mtime"
+cd ${test_tmpdir}
+rm -rf test2-checkout
+mkdir -p test2-checkout
+cd test2-checkout
+mkfifo afifo
+if $OSTREE commit -b test2 -s "Attempt to commit a FIFO" 2>../errmsg; then
+ assert_not_reached "Committing a FIFO unexpetedly succeeded!"
+ assert_file_has_content ../errmsg "Unsupported file type"
+fi
+echo "ok commit of fifo was rejected"
+